// Copyright 2011 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package bridges.twitter {
	import bridges.*;
	import bridges.picnik.*;
	import bridges.storageservice.StorageServiceInBridgeBase;
	
	import util.LocUtil;

	public class TwitterInBridgeBase extends StorageServiceInBridgeBase {
		public function TwitterInBridgeBase() {
			super();
			_tpa = AccountMgr.GetThirdPartyAccount("Twitter");
		}
		
		public override function GetMenuItems(): Array {
			return [ Bridge.EDIT_ITEM, Bridge.EMAIL_ITEM, Bridge.DOWNLOAD_ITEM ];
		}
		
		override protected function GetPhotosAndAlbums(nPhotos:Number, nAlbums:Number, strKeySuffix:String="albums"): String {
			// Avoid reporting the scary "No photos" message while the bridge is initializing
			if (nPhotos == -1)
				return "";
				
			return LocUtil.zeroOneOrMany('TwitterInBridge', nPhotos, "number_of_photos");
		}
	}
}
